package com.yyi.springcloud.controller;


import com.yyi.springcloud.entities.WindowConfigModel;
import com.yyi.springcloud.service.Local_WindowConfigService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Controller
@RequestMapping("/mysqlapi/WindowConfig")
public class Mysql_WindowConfigController {
	@Resource
	private Local_WindowConfigService windowConfigService;

	//根据条件查询窗口信息
	//http://localhost:8080/bxxs/mysqlapi/WindowConfig/getWindowConfigInfo
	@ResponseBody
	@RequestMapping(value = "/getWindowConfigInfo", method = RequestMethod.GET)
	public List<WindowConfigModel> getWindowConfigInfo(String labcode) {
		WindowConfigModel windowConfigModel=new WindowConfigModel();
		if(!StringUtils.isEmpty(labcode)){
			windowConfigModel.setLabcode(labcode);
		}
		List<WindowConfigModel> windowConfigList = windowConfigService.getWindowConfigByCondition(windowConfigModel);
		return windowConfigList;
	}
}
